package org.shay.springcloud.core.launcher.impl;

import org.shay.springcloud.common.Constants;
import org.shay.springcloud.core.launcher.LauncherService;
import org.springframework.boot.builder.SpringApplicationBuilder;

import java.util.Properties;

/**
 * @author shay
 */
public class LauncherServiceImpl implements LauncherService {

	@Override
	public void launcher(SpringApplicationBuilder builder, String appName, String profile) {
		Properties props = System.getProperties();
		props.setProperty("spring.cloud.nacos.discovery.server-addr", Constants.nacosAddr(profile));
		props.setProperty("spring.cloud.nacos.config.server-addr", Constants.nacosAddr(profile));
		props.setProperty("spring.cloud.sentinel.transport.dashboard", Constants.sentinelAddr(profile));
		props.setProperty("spring.zipkin.base-url", Constants.zipkinAddr(profile));
	}
}
